-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[NFC][SPIRV] GetElementPtrInst does not need a call to isInstructionTriviallyDead after replaceUsesofWith #162045
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NFC][SPIRV] GetElementPtrInst does not need a call to isInstructionTriviallyDead after replaceUsesofWith #162045
Conversation
…riviallyDead after replaceUsesofWith A getelementptr is always removable after replacing all its uses, since it doesn't have side effects and always returns.
@llvm/pr-subscribers-backend-spir-v Author: Juan Manuel Martinez Caamaño (jmmartinez) ChangesA getelementptr is always removable after replacing all its uses, since it doesn't have side effects and always returns. Full diff: https://github.com/llvm/llvm-project/pull/162045.diff 1 Files Affected:
diff --git a/llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp b/llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp
index 9f2e07508a36a..e16c8f0fc302e 100644
--- a/llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp
+++ b/llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp
@@ -2811,9 +2811,7 @@ bool SPIRVEmitIntrinsics::runOnFunction(Function &Func) {
GetElementPtrInst *NewGEP = simplifyZeroLengthArrayGepInst(Ref);
if (NewGEP) {
Ref->replaceAllUsesWith(NewGEP);
- if (isInstructionTriviallyDead(Ref))
- DeadInsts.insert(Ref);
-
+ DeadInsts.insert(Ref);
Ref = NewGEP;
}
if (Type *GepTy = getGEPType(Ref))
|
@VyacheslavLevytskyy is not working in this project anymore, as far as I know, so I don't think he will review. You can try @s-perron or @MrSidims instead. |
Thanks for the review and the reviewer suggestion ! |
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/18/builds/21761 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/168/builds/16519 Here is the relevant piece of the build log for the reference
|
A getelementptr is always removable after replacing all its uses, since it doesn't have side effects and always returns.